<template>
  <view class="template-topic tn-safe-area-inset-bottom">
    <!-- 顶部自定义导航 -->
    <tn-nav-bar backgroundColor="#1c1d20" @click="goBack" style="color: #fff;">创建智能体</tn-nav-bar>

    <!-- <canvas canvas-id="star_canvas" class="mycanvas" :style="'width:' + screenWidth + 'px;height:' + screenHeight + 'px;'"></canvas> -->
	
	<text :prop="options" :change:prop="renderScript.onChange" v-show="false"></text> 
	<text :prop="statusoptions" :change:prop="renderScript.checkConnectionStatus" v-show="false"></text> 

    <view class="topic" :style="{ paddingTop: vuex_custom_bar_height + 'px' }">
      <!-- 输入框内容-->
      <view class="input-box">
        <!-- 问题 -->
        <block>
          <view class="tn-text">
            设置智能体基本信息
          </view>
          <view class="tn-margin tn-bg-gray--light" style="border-radius: 30rpx;padding: 20rpx 30rpx;color: #fff;">
            <input v-model="makeNewAvatar.title" maxlength="20" placeholder-style="color:#AAAAAA"
              placeholder="设置智能体昵称" />
          </view>
		  
		  <view class="tn-margin tn-bg-gray--light" style="border-radius: 30rpx;padding: 20rpx 30rpx;color: #fff;">
		    <input v-model="makeNewAvatar.timbre" maxlength="20" placeholder-style="color:#AAAAAA"
		      placeholder="设置智能体开场白" />
		  </view>

          <view class="tn-margin tn-bg-gray--light  tn-color-grey-dark"
            style="width: 92%;border-radius: 30rpx;padding: 20rpx 30rpx;">
            <textarea style="width: 100%;font-size: 13px;color: #fff;" v-model="makeNewAvatar.description" maxlength="1280"
              placeholder="设置智能体简介(对他人展示)" placeholder-style="color:#AAAAAA"></textarea>
          </view>


        </block>
      </view>
	  
	  <tt-cropper
	    mode="ratio"
	    :imageUrl="model.imageUrl"
	    :width="1080"
	    :height="2337"
	    :delay="300"
	    @cancel="onCancel"
	    @confirm="onConfirm"
	  ></tt-cropper>

      <view class="input-box">
        <block>
          <view class="tn-text">
            设置智能体形象<br/>
			(图片小于10M，需要露出人脸及上半身。)
          </view>

         <!-- <view class="tn-flex tn-flex-row-between tn-flex-col-center tn-margin">
            <view class="justify-content-item tn-text-df tn-color-grey" @tap="clear">
              <text class="tn-padding-xs">清空上传</text>
              <text class="tn-icon-delete"></text>
            </view>
          </view>

          <view class="tn-margin-left tn-padding-top-xs">
            <tn-image-upload-drag :image="localImage" ref="imageUpload" :action="action" :width="200" :height="200" @on-success="handleSuccess"/>

          </view> -->
		  
		  <view class="preview">
		    <image v-if="trueimgurl == '' && !showuploading"
		      class="images"
		      @click="selectFile"
		      src="/static/image/icon_add.png"
		    />
			<image v-if="showuploading"
			  class="images3"
			  @click="selectFile"
			  src="/static/uploading.gif"
			/>
			<image v-if="trueimgurl != '' && !showuploading"
			  class="images2"
			  mode="aspectFill"
			  @click="prviewImgae(0, trueimgurl)"
			  :src="trueimgurl"
			/>
			<text class="tn-padding-xs tn-color-white" @click="clear()">清空上传</text>
			<text class="tn-icon-delete-fill tn-padding-right-xs tn-text-lg tn-color-white" @click="clear()"></text>
		  </view>
		  
		  <view class="tn-text">
		    (点击图片预览，可长按保存图片)
		  </view>
		  
		  <view class="tn-text">
			  <br/>
		    是否美化特效
			
			<view class="select-content">
			  <view class="select-content-item" v-for="item in typeList3" :key="item.id"
			    :class="{ 'select-content-item-active': item.id == currentIndex3 }" @tap="onSelectType3(item.id)">
			    {{ item.name }}
			  </view>
			</view>
		  	  
		  </view>
		  
		  <view
		    class="topic__info__item__input tn-flex tn-flex-direction-row tn-flex-nowrap tn-flex-col-center tn-flex-row-left" v-if="currentIndex3 == 1">
		  
		  
		  
		    <view class="topic__info__item__input__content">
		  			  <picker v-model="volcengineName" mode="selector" :range="volcengine" @change="onChangeVolcengine">
		  			    {{ volcengineName }}
		  			  </picker>
		    </view>
		    <view class="topic__info__item__input__right-icon">
		      <picker v-model="volcengineName" mode="selector" :range="volcengine" @change="onChangeVolcengine">
		        <view class="picker">
		          <view class="tn-icon-down"></view>
		        </view>
		      </picker>
		    </view>
		  </view>

          <!-- <view class="tn-flex tn-flex-row-between tn-flex-col-center tn-margin">
            <view class="tn-flex justify-content-item">

              <view class="tn-text-lg tn-padding-right-xs tn-text-bold" style="color:#FFF;">类型选择</view>
            </view>
            <view class="justify-content-item tn-text-df tn-color-grey">
              <text class="tn-padding-xs">选择</text>
              <text class="tn-icon-right"></text>
            </view>
          </view> -->
        </block>
      </view>
	  
	  <view class="input-box input-box-padding">
	    <block>
	      <view class="tn-text1">
	        设置智能体私密公开
	  
	      </view>
	  
	      <view class="select-content">
	        <view class="select-content-item" v-for="item in typeList2" :key="item.id"
	          :class="{ 'select-content-item-active': item.id == currentIndex2 }" @tap="onSelectType2(item.id)">
	          {{ item.name }}
	        </view>
	      </view>
	  
	      <!-- <view
	        class="topic__info__item__input tn-flex tn-flex-direction-row tn-flex-nowrap tn-flex-col-center tn-flex-row-left">
	  
	  
	  
	        <view class="topic__info__item__input__content">
	          {{ makeNewAvatar.sex }}
	        </view>
	        <view class="topic__info__item__input__right-icon">
	          <picker v-model="makeNewAvatar.sex" mode="selector" :range="sexList" @change="onChangeSex">
	            <view class="picker">
	              <view class="tn-icon-down"></view>
	            </view>
	          </picker>
	        </view>
	  
	      </view> -->
	    </block>
	  </view>
	  
	  <view class="input-box input-box-padding">
	    <block>
	      <view class="tn-text1">
	        设置智能体性别
	  
	      </view>
	  
	      <view class="select-content">
	        <view class="select-content-item" v-for="item in typeList" :key="item.id"
	          :class="{ 'select-content-item-active': item.id == currentIndex }" @tap="onSelectType(item.id)">
	          {{ item.name }}
	        </view>
	      </view>
	  
	      <!-- <view
	        class="topic__info__item__input tn-flex tn-flex-direction-row tn-flex-nowrap tn-flex-col-center tn-flex-row-left">
	  
	  
	  
	        <view class="topic__info__item__input__content">
	          {{ makeNewAvatar.sex }}
	        </view>
	        <view class="topic__info__item__input__right-icon">
	          <picker v-model="makeNewAvatar.sex" mode="selector" :range="sexList" @change="onChangeSex">
	            <view class="picker">
	              <view class="tn-icon-down"></view>
	            </view>
	          </picker>
	        </view>
	  
	      </view> -->
	    </block>
	  </view>

      <view class="input-box input-box-padding2 ">
        <block>
          <view class="tn-text1">
            <!-- 设置智能体音色 -->
			<view class="tn-flex tn-flex-row-between tn-flex-col-center tn-margin-min">
			  <view class="justify-content-item">
			    <view class="tn-flex tn-flex-row-center tn-flex-col-center">
			      <view class="tn-flex tn-flex-row-center tn-padding-right">
			        <!-- <text class="tn-text-bold tn-text-xxl" style="color: #B0B7C6;">{{ item.id }}</text> -->
					<!-- <radio value="1" color="#CCCCCC"/> -->
					设置智能体音色
			      </view>
			      <view class="tn-flex tn-flex-row-center tn-flex-col-center">
			        <!-- <tn-avatar
			          class=""
			          shape="circle"
			          :src="item.userAvatar">
			        </tn-avatar> -->
			        <view class="avatar-all">
			          <view class="tn-padding-right tn-padding-left-sm tn-text-bold tn-text-lg"></view>
			        </view>
			        
			      </view>
			    </view>
			  </view>
			  <view class="justify-content-item tn-flex-row-center" @click="handleShow">
			    <text class="tn-padding-xs">选择音色</text>
			    <text class="tn-icon-deploy-fill"></text>
			  </view>
			</view>
          </view>

          <!-- <view
            class="topic__info__item__input tn-flex tn-flex-direction-row tn-flex-nowrap tn-flex-col-center tn-flex-row-left">



            <view class="topic__info__item__input__content">
			  <picker v-model="makeNewAvatar.timbre" mode="selector" :range="timbreName" @change="onChangeContent">
			    {{ makeNewAvatar.timbreName }}
			  </picker>
            </view>
            <view class="topic__info__item__input__right-icon">
              <picker v-model="makeNewAvatar.timbre" mode="selector" :range="timbreName" @change="onChangeContent">
                <view class="picker">
                  <view class="tn-icon-down"></view>
                </view>
              </picker>
            </view>
          </view> -->

		  <radio-group v-if="isMenuShow">
		  <block v-for="(item,index) in timbre" :key="index">
		    <view class="tn-flex tn-flex-row-between tn-flex-col-center tn-margin-xs">
		      <view class="justify-content-item tn-margin-top">
		        <view class="tn-flex tn-flex-row-center tn-flex-col-center">
		          <!-- <view class="tn-flex tn-flex-row-center tn-padding-right">
					<radio :value="item.type" @click="radioCheck(item.type)" color="#000000"/>
		          </view> -->
		          <view class="tn-flex tn-flex-row-center tn-flex-col-center">
		            <!-- <tn-avatar
		              class=""
		              shape="circle"
		              :src="item.userAvatar">
		            </tn-avatar> -->
		            <view class="avatar-all">
		              <view class="tn-padding-right tn-padding-left-sm tn-text-bold tn-text-lg" style="color: #B0B7C6;" @click="onPlay(item.id,item.type)">{{ item.name }}<text class="tn-icon-success" style="padding-left: 18rpx;font-size: 40rpx;color: #B0B7C6;" v-if="item.isPlay"></text></view>
		            </view>
		            
		          </view>
		        </view>
		      </view>
		      <view class="justify-content-item tn-flex-row-center tn-margin-top">
		        <text class="tn-icon-video" style="font-size: 44rpx;color: #fff;" v-if="item.id != 0 && !item.isPlay" @click="onPlay(item.id,item.type)"></text>
				<text class="tn-icon-video-fill" style="font-size: 44rpx;color: #fff;" v-if="item.id != 0 && item.isPlay" @click="onPlay(item.id,item.type)"></text>
		      </view>
		    </view>
		  </block>
		  </radio-group>
        </block>
      </view>

    </view>

    <view class="bottom-box" v-if="!loading && !submiting">
      <view style="position: relative; left: 5%;margin-top: 20px;">
        <tn-button shape="round" backgroundColor="#616DBA" padding="40rpx 0" width="90%" :fontSize="32" fontBold
          @click="submit">
          <text class="tn-color-grey-dark">创 建</text>
        </tn-button>
      </view>
    </view>
	
	<view class="bottom-box" v-if="!loading && submiting">
	  <view style="position: relative; left: 5%;margin-top: 20px;">
	    <tn-button shape="round" backgroundColor="#ababab" padding="40rpx 0" width="90%" :fontSize="32" fontBold>
	      <text class="tn-color-grey-dark">提交中...</text>
	    </tn-button>
	  </view>
	</view>
	
	<!-- <view class="bottom-box" v-if="loading">
	  <view style="position: relative; left: 5%;margin-top: 20px;">
	    <tn-button shape="round" backgroundColor="#FBE6B1" padding="40rpx 0" width="90%" :fontSize="32" fontBold>
	      <text class="tn-color-grey-dark">图片校验中..</text>
	    </tn-button>
	  </view>
	</view> -->
  </view>
</template>

<script>
import template_page_mixin from '@/libs/mixin/template_page_mixin.js'
import { base64ToFile } from "@/common/tools.js"; // 这里替换成你自己的文件路径
import { pathToBase64, base64ToPath } from 'mmmm-image-tools'


const Point = class {
  constructor(x, y) {
    this.x = x
    this.y = y
    this.r = 1 + Math.random() * 2
    this.sx = Math.random() * 2 - 1
    this.sy = Math.random() * 2 - 1
  }

  draw(ctx) {
    ctx.beginPath()
    ctx.arc(this.x, this.y, this.r, 0, 2 * Math.PI)
    ctx.closePath()
    ctx.fillStyle = '#fff'
    ctx.fill()
  }

  move(w, h) {
    this.x += this.sx
    this.y += this.sy
    if (this.x > w || this.x < 0) this.sx = -this.sx
    if (this.y > h || this.y < 0) this.sy = -this.sy
  }

  drawLine(ctx, p) {
    const dx = this.x - p.x
    const dy = this.y - p.y
    const d = Math.sqrt(dx * dx + dy * dy)
    if (d < 100) {
      var alpha = (100 - d) / 300 * 1
      ctx.beginPath()
      ctx.moveTo(this.x, this.y)
      ctx.lineTo(p.x, p.y)
      ctx.closePath()
      ctx.strokeStyle = 'rgba(255, 255, 255, ' + alpha + ')'
      ctx.strokeWidth = 1
      ctx.stroke()
    }
  }
}

const sysinfo = uni.getSystemInfoSync()
const w = 400
const h = 1000
const innerAudioContext = uni.createInnerAudioContext()

export default {
  name: 'TemplateTopic',
  mixins: [template_page_mixin],
  data() {
    return {
	  model: {
		imageUrl: "",
		resultUrl: [],
	  },
      // 当前选中的模式
      currentModeIndex: 0,
	  voicePlayingId: '',		// 正在播放的消息ID
      // 粒子
      ctx: null,
      screenWidth: sysinfo.screenWidth,
      screenHeight: sysinfo.screenHeight,
      timer: null,
      points: [],
	  loading: false,
	  abortController: null,
	  options: {},
	  statusoptions: {},
	  imageBase64: '',
	  localImage: '/static/image/icon_addu2g.png',
      action: 'https://api.cycyai.com/index.php?m=upload&a=img&ajax=1',
      sexList: ['请选择性别', '男', '女'],
	  myTimbre: [],
	  volcengine: ['不美化特效', '智能变美', '幻想风美颜', '人像特效/3D卡通风', '人像特效/天使', '人像特效/恶魔', '3d超写实风格'],
	  volcengineName: '选择美化特效',
      timbreName: ['请选择音色', '爽快思思/Skye', '温暖阿虎/Alvin', '少年梓辛/Brayan', '邻家女孩', '渊博小叔', '阳光青年',
        '甜美小源', '清澈梓梓', '解说小明', '开朗姐姐', '邻家男孩', '甜美悦悦', '心灵鸡汤', '京腔侃爷/Harmony', '湾湾小何', '湾区大叔', '呆萌川妹', '广州德哥',
        '北京小爷', '浩宇小哥', '广西远舟', '妹坨洁儿', '豫州子轩', '高冷御姐', '傲娇霸总', '魅力女友', '深夜播客', '柔美女友', '撒娇学妹', '病弱少女',
        '活泼女孩', '和蔼奶奶', '邻居阿姨', '温柔小雅', '东方浩然'],
      roleList: ['请选择性格', '鲁迅', '潘金莲', '舔狗男', '舔狗女', '高冷御姐', '霸道总裁'],
      role: ['', 'LuXun', 'PanJinLian', 'TianGouNan', 'TianGouNv', 'GaoLengYuJie', 'BaDaoZongCai'],
      timbre: [ {
        id: 1,
        name: '爽快思思/Skye',
        type: 'zh_female_shuangkuaisisi_moon_bigtts',
		isPlay: false
      }, {
        id: 2,
        name: '温暖阿虎/Alvin',
        type: 'zh_male_wennuanahu_moon_bigtts',
		isPlay: false
      }, {
        id: 3,
        name: '少年梓辛/Brayan',
        type: 'zh_male_shaonianzixin_moon_bigtts',
		isPlay: false
      }, {
        id: 4,
        name: '邻家女孩',
        type: 'zh_female_linjianvhai_moon_bigtts',
		isPlay: false
      }, {
        id: 5,
        name: '渊博小叔',
        type: 'zh_male_yuanboxiaoshu_moon_bigtts',
		isPlay: false
      }, {
        id: 6,
        name: '阳光青年',
        type: 'zh_male_yangguangqingnian_moon_bigtts',
		isPlay: false
      }, {
        id: 7,
        name: '甜美小源',
        type: 'zh_female_tianmeixiaoyuan_moon_bigtts',
		isPlay: false
      }, {
        id: 8,
        name: '清澈梓梓',
        type: 'zh_female_qingchezizi_moon_bigtts',
		isPlay: false
      }, {
        id: 9,
        name: '解说小明',
        type: 'zh_male_jieshuoxiaoming_moon_bigtts',
		isPlay: false
      }, {
        id: 10,
        name: '开朗姐姐',
        type: 'zh_female_kailangjiejie_moon_bigtts',
		isPlay: false
      }, {
        id: 11,
        name: '邻家男孩',
        type: 'zh_male_linjiananhai_moon_bigtts',
		isPlay: false
      }, {
        id: 12,
        name: '甜美悦悦',
        type: 'zh_female_tianmeiyueyue_moon_bigtts',
		isPlay: false
      }, {
        id: 13,
        name: '心灵鸡汤',
        type: 'zh_female_xinlingjitang_moon_bigtts',
		isPlay: false
      }, {
        id: 14,
        name: '京腔侃爷/Harmony',
        type: 'zh_male_jingqiangkanye_moon_bigtts',
		isPlay: false
      }, {
        id: 15,
        name: '湾湾小何',
        type: 'zh_female_wanwanxiaohe_moon_bigtts',
		isPlay: false
      }, {
        id: 16,
        name: '湾区大叔',
        type: 'zh_female_wanqudashu_moon_bigtts',
		isPlay: false
      }, {
        id: 17,
        name: '呆萌川妹',
        type: 'zh_female_daimengchuanmei_moon_bigtts',
		isPlay: false
      }, {
        id: 18,
        name: '广州德哥',
        type: 'zh_male_guozhoudege_moon_bigtts',
		isPlay: false
      }, {
        id: 19,
        name: '北京小爷',
        type: 'zh_male_beijingxiaoye_moon_bigtts',
		isPlay: false
      }, {
        id: 20,
        name: '浩宇小哥',
        type: 'zh_male_haoyuxiaoge_moon_bigtts',
		isPlay: false
      }, {
        id: 21,
        name: '广西远舟',
        type: 'zh_male_guangxiyuanzhou_moon_bigtts',
		isPlay: false
      }, {
        id: 22,
        name: '妹坨洁儿',
        type: 'zh_female_meituojieer_moon_bigtts',
		isPlay: false
      }, {
        id: 23,
        name: '豫州子轩',
        type: 'zh_male_yuzhouzixuan_moon_bigtts',
		isPlay: false
      }, {
        id: 24,
        name: '高冷御姐',
        type: 'zh_female_gaolengyujie_moon_bigtts',
		isPlay: false
      }, {
        id: 25,
        name: '傲娇霸总',
        type: 'zh_male_aojiaobazong_moon_bigtts',
		isPlay: false
      }, {
        id: 26,
        name: '魅力女友',
        type: 'zh_female_meilinvyou_moon_bigtts',
		isPlay: false
      }, {
        id: 27,
        name: '深夜播客',
        type: 'zh_male_shenyeboke_moon_bigtts',
		isPlay: false
      }, {
        id: 28,
        name: '柔美女友',
        type: 'zh_female_sajiaonvyou_moon_bigtts',
		isPlay: false
      }, {
        id: 29,
        name: '撒娇学妹',
        type: 'zh_female_yuanqinvyou_moon_bigtts',
		isPlay: false
      }, {
        id: 30,
        name: '病弱少女',
        type: 'ICL_zh_female_bingruoshaonv_tob',
		isPlay: false
      }, {
        id: 31,
        name: '活泼女孩',
        type: 'ICL_zh_female_huoponvhai_tob',
		isPlay: false
      }, {
        id: 32,
        name: '和蔼奶奶',
        type: 'ICL_zh_female_heainainai_tob',
		isPlay: false
      }, {
        id: 33,
        name: '邻居阿姨',
        type: 'ICL_zh_female_linjuayi_tob',
		isPlay: false
      }, {
        id: 34,
        name: '温柔小雅',
        type: 'zh_female_wenrouxiaoya_moon_bigtts',
		isPlay: false
      }, {
        id: 35,
        name: '东方浩然',
        type: 'zh_male_dongfanghaoran_moon_bigtts',
		isPlay: false
      }, {
        id: 36,
        name: '灿灿/Shiny',
        type: 'zh_female_cancan_mars_bigtts',
		isPlay: false
      }, {
        id: 37,
        name: '清新女声',
        type: 'zh_female_qingxinnvsheng_mars_bigtts',
		isPlay: false
      }, {
        id: 38,
        name: '邻家小妹/Lily',
        type: 'zh_female_linjia_mars_bigtts',
		isPlay: false
      }, {
        id: 39,
        name: '知性女声',
        type: 'zh_female_zhixingnvsheng_mars_bigtts',
		isPlay: false
      }, {
        id: 40,
        name: '清爽男大',
        type: 'zh_male_qingshuangnanda_mars_bigtts',
		isPlay: false
      }, {
        id: 41,
        name: '知性温婉',
        type: 'ICL_zh_female_zhixingwenwan_tob',
		isPlay: false
      }, {
        id: 42,
        name: '暖心体贴',
        type: 'ICL_zh_male_nuanxintitie_tob',
		isPlay: false
      }, {
        id: 43,
        name: '温柔文雅',
        type: 'ICL_zh_female_wenrouwenya_tob',
		isPlay: false
      }, {
        id: 44,
        name: '开朗轻快',
        type: 'ICL_zh_male_kailangqingkuai_tob',
		isPlay: false
      }, {
        id: 45,
        name: '活泼爽朗',
        type: 'ICL_zh_male_huoposhuanglang_tob',
		isPlay: false
      }, {
        id: 46,
        name: '率真小伙',
        type: 'ICL_zh_male_shuaizhenxiaohuo_tob',
		isPlay: false
      }, {
        id: 47,
        name: '奶气萌娃',
        type: 'zh_male_naiqimengwa_mars_bigtts',
		isPlay: false
      }, {
        id: 48,
        name: '婆婆',
        type: 'zh_female_popo_mars_bigtts',
		isPlay: false
      }, {
        id: 49,
        name: '绿茶小哥',
        type: 'ICL_zh_male_lvchaxiaoge_tob',
		isPlay: false
      }, {
        id: 50,
        name: '娇弱萝莉',
        type: 'ICL_zh_female_jiaoruoluoli_tob',
		isPlay: false
      }, {
        id: 51,
        name: '冷淡疏离',
        type: 'ICL_zh_male_lengdanshuli_tob',
		isPlay: false
      }, {
        id: 52,
        name: '憨厚敦实',
        type: 'ICL_zh_male_hanhoudunshi_tob',
		isPlay: false
      }, {
        id: 53,
        name: '傲气凌人',
        type: 'ICL_zh_male_aiqilingren_tob',
		isPlay: false
      }, {
        id: 54,
        name: '活泼刁蛮',
        type: 'ICL_zh_female_huopodiaoman_tob',
		isPlay: false
      }, {
        id: 55,
        name: '固执病娇',
        type: 'ICL_zh_male_guzhibingjiao_tob',
		isPlay: false
      }, {
        id: 56,
        name: '撒娇粘人',
        type: 'ICL_zh_male_sajiaonianren_tob',
		isPlay: false
      }, {
        id: 57,
        name: '傲慢娇声',
        type: 'ICL_zh_female_aomanjiaosheng_tob',
		isPlay: false
      }, {
        id: 58,
        name: '潇洒随性',
        type: 'ICL_zh_male_xiaosasuixing_tob',
		isPlay: false
      }, {
        id: 59,
        name: '腹黑公子',
        type: 'ICL_zh_male_fuheigongzi_tob',
		isPlay: false
      }, {
        id: 60,
        name: '诡异神秘',
        type: 'ICL_zh_male_guiyishenmi_tob',
		isPlay: false
      }, {
        id: 61,
        name: '儒雅才俊',
        type: 'ICL_zh_male_ruyacaijun_tob',
		isPlay: false
      }, {
        id: 62,
        name: '病娇白莲',
        type: 'ICL_zh_male_bingjiaobailian_tob',
		isPlay: false
      }, {
        id: 63,
        name: '正直青年',
        type: 'ICL_zh_male_zhengzhiqingnian_tob',
		isPlay: false
      }, {
        id: 64,
        name: '娇憨女王',
        type: 'ICL_zh_female_jiaohannvwang_tob',
		isPlay: false
      }, {
        id: 65,
        name: '病娇萌妹',
        type: 'ICL_zh_female_bingjiaomengmei_tob',
		isPlay: false
      }, {
        id: 66,
        name: '青涩小生',
        type: 'ICL_zh_male_qingsenaigou_tob',
		isPlay: false
      }, {
        id: 67,
        name: '纯真学弟',
        type: 'ICL_zh_male_chunzhenxuedi_tob',
		isPlay: false
      }, {
        id: 68,
        name: '暖心学姐',
        type: 'ICL_zh_female_nuanxinxuejie_tob',
		isPlay: false
      }, {
        id: 69,
        name: '可爱女生',
        type: 'ICL_zh_female_keainvsheng_tob',
		isPlay: false
      }, {
        id: 70,
        name: '成熟姐姐',
        type: 'ICL_zh_female_chengshujiejie_tob',
		isPlay: false
      }, {
        id: 71,
        name: '病娇姐姐',
        type: 'ICL_zh_female_bingjiaojiejie_tob',
		isPlay: false
      }, {
        id: 72,
        name: '优柔帮主',
        type: 'ICL_zh_male_youroubangzhu_tob',
		isPlay: false
      }, {
        id: 73,
        name: '优柔公子',
        type: 'ICL_zh_male_yourougongzi_tob',
		isPlay: false
      }, {
        id: 74,
        name: '妩媚御姐',
        type: 'ICL_zh_female_wumeiyujie_tob',
		isPlay: false
      }, {
        id: 75,
        name: '调皮公主',
        type: 'ICL_zh_female_tiaopigongzhu_tob',
		isPlay: false
      }, {
        id: 76,
        name: '傲娇女友',
        type: 'ICL_zh_female_aojiaonvyou_tob',
		isPlay: false
      }, {
        id: 77,
        name: '贴心男友',
        type: 'ICL_zh_male_tiexinnanyou_tob',
		isPlay: false
      }, {
        id: 78,
        name: '少年将军',
        type: 'ICL_zh_male_shaonianjiangjun_tob',
		isPlay: false
      }, {
        id: 79,
        name: '贴心女友',
        type: 'ICL_zh_female_tiexinnvyou_tob',
		isPlay: false
      }, {
        id: 80,
        name: '病娇哥哥',
        type: 'ICL_zh_male_bingjiaogege_tob',
		isPlay: false
      }, {
        id: 81,
        name: '学霸男同桌',
        type: 'ICL_zh_male_xuebanantongzhuo_tob',
		isPlay: false
      }, {
        id: 82,
        name: '幽默叔叔',
        type: 'ICL_zh_male_youmoshushu_tob',
		isPlay: false
      }, {
        id: 83,
        name: '性感御姐',
        type: 'ICL_zh_female_xingganyujie_tob',
		isPlay: false
      }, {
        id: 84,
        name: '假小子',
        type: 'ICL_zh_female_jiaxiaozi_tob',
		isPlay: false
      }, {
        id: 85,
        name: '冷峻上司',
        type: 'ICL_zh_male_lengjunshangsi_tob',
		isPlay: false
      }, {
        id: 86,
        name: '温柔男同桌',
        type: 'ICL_zh_male_wenrounantongzhuo_tob',
		isPlay: false
      }, {
        id: 87,
        name: '病娇弟弟',
        type: 'ICL_zh_male_bingjiaodidi_tob',
		isPlay: false
      }, {
        id: 88,
        name: '幽默大爷',
        type: 'ICL_zh_male_youmodaye_tob',
		isPlay: false
      }, {
        id: 89,
        name: '傲慢少爷',
        type: 'ICL_zh_male_aomanshaoye_tob',
		isPlay: false
      }, {
        id: 90,
        name: '神秘法师',
        type: 'ICL_zh_male_shenmifashi_tob',
		isPlay: false
      }, {
        id: 91,
        name: '天才童声',
        type: 'zh_male_tiancaitongsheng_mars_bigtts',
		isPlay: false
      }, {
        id: 92,
        name: '猴哥',
        type: 'zh_male_sunwukong_mars_bigtts',
		isPlay: false
      }, {
        id: 93,
        name: '熊二',
        type: 'zh_male_xionger_mars_bigtts',
		isPlay: false
      }, {
        id: 94,
        name: '佩奇猪',
        type: 'zh_female_peiqi_mars_bigtts',
		isPlay: false
      }, {
        id: 95,
        name: '武则天',
        type: 'zh_female_wuzetian_mars_bigtts',
		isPlay: false
      }, {
        id: 96,
        name: '顾姐',
        type: 'zh_female_gujie_mars_bigtts',
		isPlay: false
      }, {
        id: 97,
        name: '樱桃丸子',
        type: 'zh_female_yingtaowanzi_mars_bigtts',
		isPlay: false
      }, {
        id: 98,
        name: '广告解说',
        type: 'zh_male_chunhui_mars_bigtts',
		isPlay: false
      }, {
        id: 99,
        name: '少儿故事',
        type: 'zh_female_shaoergushi_mars_bigtts',
		isPlay: false
      }, {
        id: 100,
        name: '四郎',
        type: 'zh_male_silang_mars_bigtts',
		isPlay: false
      }, {
        id: 101,
        name: '磁性解说男声/Morgan',
        type: 'zh_male_jieshuonansheng_mars_bigtts',
		isPlay: false
      }, {
        id: 102,
        name: '鸡汤妹妹/Hope',
        type: 'zh_female_jitangmeimei_mars_bigtts',
		isPlay: false
      }, {
        id: 103,
        name: '贴心女声/Candy',
        type: 'zh_female_tiexinnvsheng_mars_bigtts',
		isPlay: false
      }, {
        id: 104,
        name: '俏皮女声',
        type: 'zh_female_qiaopinvsheng_mars_bigtts',
		isPlay: false
      }, {
        id: 105,
        name: '萌丫头/Cutey',
        type: 'zh_female_mengyatou_mars_bigtts',
		isPlay: false
      }, {
        id: 106,
        name: '悬疑解说',
        type: 'zh_male_changtianyi_mars_bigtts',
		isPlay: false
      }, {
        id: 107,
        name: '儒雅青年',
        type: 'zh_male_ruyaqingnian_mars_bigtts',
		isPlay: false
      }, {
        id: 108,
        name: '霸气青叔',
        type: 'zh_male_baqiqingshu_mars_bigtts',
		isPlay: false
      }, {
        id: 109,
        name: '擎苍',
        type: 'zh_male_qingcang_mars_bigtts',
		isPlay: false
      }, {
        id: 110,
        name: '活力小哥',
        type: 'zh_male_yangguangqingnian_mars_bigtts',
		isPlay: false
      }, {
        id: 111,
        name: '古风少御',
        type: 'zh_female_gufengshaoyu_mars_bigtts',
		isPlay: false
      }, {
        id: 112,
        name: '温柔淑女',
        type: 'zh_female_wenroushunv_mars_bigtts',
		isPlay: false
      }],
	  timbregirl: [ {
	    id: 1,
	    name: '爽快思思/Skye',
	    type: 'zh_female_shuangkuaisisi_moon_bigtts',
	  		isPlay: false
	  }, {
	    id: 2,
	    name: '邻家女孩',
	    type: 'zh_female_linjianvhai_moon_bigtts',
	  		isPlay: false
	  }, {
	    id: 3,
	    name: '甜美小源',
	    type: 'zh_female_tianmeixiaoyuan_moon_bigtts',
	  		isPlay: false
	  }, {
	    id: 4,
	    name: '清澈梓梓',
	    type: 'zh_female_qingchezizi_moon_bigtts',
	  		isPlay: false
	  }, {
	    id: 5,
	    name: '开朗姐姐',
	    type: 'zh_female_kailangjiejie_moon_bigtts',
	  		isPlay: false
	  }, {
	    id: 6,
	    name: '甜美悦悦',
	    type: 'zh_female_tianmeiyueyue_moon_bigtts',
	  		isPlay: false
	  }, {
	    id: 7,
	    name: '心灵鸡汤',
	    type: 'zh_female_xinlingjitang_moon_bigtts',
	  		isPlay: false
	  }, {
	    id: 8,
	    name: '湾湾小何',
	    type: 'zh_female_wanwanxiaohe_moon_bigtts',
	  		isPlay: false
	  }, {
	    id: 9,
	    name: '呆萌川妹',
	    type: 'zh_female_daimengchuanmei_moon_bigtts',
	  		isPlay: false
	  }, {
	    id: 10,
	    name: '妹坨洁儿',
	    type: 'zh_female_meituojieer_moon_bigtts',
	  		isPlay: false
	  }, {
	    id: 11,
	    name: '高冷御姐',
	    type: 'zh_female_gaolengyujie_moon_bigtts',
	  		isPlay: false
	  }, {
	    id: 12,
	    name: '魅力女友',
	    type: 'zh_female_meilinvyou_moon_bigtts',
	  		isPlay: false
	  }, {
	    id: 13,
	    name: '柔美女友',
	    type: 'zh_female_sajiaonvyou_moon_bigtts',
	  		isPlay: false
	  }, {
	    id: 14,
	    name: '撒娇学妹',
	    type: 'zh_female_yuanqinvyou_moon_bigtts',
	  		isPlay: false
	  }, {
	    id: 15,
	    name: '病弱少女',
	    type: 'ICL_zh_female_bingruoshaonv_tob',
	  		isPlay: false
	  }, {
	    id: 16,
	    name: '活泼女孩',
	    type: 'ICL_zh_female_huoponvhai_tob',
	  		isPlay: false
	  }, {
	    id: 17,
	    name: '和蔼奶奶',
	    type: 'ICL_zh_female_heainainai_tob',
	  		isPlay: false
	  }, {
	    id: 18,
	    name: '邻居阿姨',
	    type: 'ICL_zh_female_linjuayi_tob',
	  		isPlay: false
	  }, {
	    id: 19,
	    name: '温柔小雅',
	    type: 'zh_female_wenrouxiaoya_moon_bigtts',
	  		isPlay: false
	  }, {
	    id: 20,
	    name: '灿灿/Shiny',
	    type: 'zh_female_cancan_mars_bigtts',
	  		isPlay: false
	  }, {
	    id: 21,
	    name: '清新女声',
	    type: 'zh_female_qingxinnvsheng_mars_bigtts',
	  		isPlay: false
	  }, {
	    id: 22,
	    name: '邻家小妹/Lily',
	    type: 'zh_female_linjia_mars_bigtts',
	  		isPlay: false
	  }, {
	    id: 23,
	    name: '知性女声',
	    type: 'zh_female_zhixingnvsheng_mars_bigtts',
	  		isPlay: false
	  }, {
	    id: 24,
	    name: '知性温婉',
	    type: 'ICL_zh_female_zhixingwenwan_tob',
	  		isPlay: false
	  }, {
	    id: 25,
	    name: '温柔文雅',
	    type: 'ICL_zh_female_wenrouwenya_tob',
	  		isPlay: false
	  }, {
	    id: 26,
	    name: '奶气萌娃',
	    type: 'zh_male_naiqimengwa_mars_bigtts',
	  		isPlay: false
	  }, {
	    id: 27,
	    name: '婆婆',
	    type: 'zh_female_popo_mars_bigtts',
	  		isPlay: false
	  }, {
	    id: 28,
	    name: '娇弱萝莉',
	    type: 'ICL_zh_female_jiaoruoluoli_tob',
	  		isPlay: false
	  }, {
	    id: 29,
	    name: '活泼刁蛮',
	    type: 'ICL_zh_female_huopodiaoman_tob',
	  		isPlay: false
	  }, {
	    id: 30,
	    name: '傲慢娇声',
	    type: 'ICL_zh_female_aomanjiaosheng_tob',
	  		isPlay: false
	  }, {
	    id: 31,
	    name: '娇憨女王',
	    type: 'ICL_zh_female_jiaohannvwang_tob',
	  		isPlay: false
	  }, {
	    id: 32,
	    name: '病娇萌妹',
	    type: 'ICL_zh_female_bingjiaomengmei_tob',
	  		isPlay: false
	  }, {
	    id: 33,
	    name: '暖心学姐',
	    type: 'ICL_zh_female_nuanxinxuejie_tob',
	  		isPlay: false
	  }, {
	    id: 34,
	    name: '可爱女生',
	    type: 'ICL_zh_female_keainvsheng_tob',
	  		isPlay: false
	  }, {
	    id: 35,
	    name: '成熟姐姐',
	    type: 'ICL_zh_female_chengshujiejie_tob',
	  		isPlay: false
	  }, {
	    id: 36,
	    name: '病娇姐姐',
	    type: 'ICL_zh_female_bingjiaojiejie_tob',
	  		isPlay: false
	  }, {
	    id: 37,
	    name: '妩媚御姐',
	    type: 'ICL_zh_female_wumeiyujie_tob',
	  		isPlay: false
	  }, {
	    id: 38,
	    name: '调皮公主',
	    type: 'ICL_zh_female_tiaopigongzhu_tob',
	  		isPlay: false
	  }, {
	    id: 39,
	    name: '傲娇女友',
	    type: 'ICL_zh_female_aojiaonvyou_tob',
	  		isPlay: false
	  }, {
	    id: 40,
	    name: '贴心女友',
	    type: 'ICL_zh_female_tiexinnvyou_tob',
	  		isPlay: false
	  }, {
	    id: 41,
	    name: '性感御姐',
	    type: 'ICL_zh_female_xingganyujie_tob',
	  		isPlay: false
	  }, {
	    id: 42,
	    name: '假小子',
	    type: 'ICL_zh_female_jiaxiaozi_tob',
	  		isPlay: false
	  }, {
	    id: 43,
	    name: '天才童声',
	    type: 'zh_male_tiancaitongsheng_mars_bigtts',
	  		isPlay: false
	  }, {
	    id: 44,
	    name: '佩奇猪',
	    type: 'zh_female_peiqi_mars_bigtts',
	  		isPlay: false
	  }, {
	    id: 45,
	    name: '武则天',
	    type: 'zh_female_wuzetian_mars_bigtts',
	  		isPlay: false
	  }, {
	    id: 46,
	    name: '顾姐',
	    type: 'zh_female_gujie_mars_bigtts',
	  		isPlay: false
	  }, {
	    id: 47,
	    name: '樱桃丸子',
	    type: 'zh_female_yingtaowanzi_mars_bigtts',
	  		isPlay: false
	  }, {
	    id: 48,
	    name: '少儿故事',
	    type: 'zh_female_shaoergushi_mars_bigtts',
	  		isPlay: false
	  }, {
	    id: 49,
	    name: '鸡汤妹妹/Hope',
	    type: 'zh_female_jitangmeimei_mars_bigtts',
	  		isPlay: false
	  }, {
	    id: 50,
	    name: '贴心女声/Candy',
	    type: 'zh_female_tiexinnvsheng_mars_bigtts',
	  		isPlay: false
	  }, {
	    id: 51,
	    name: '俏皮女声',
	    type: 'zh_female_qiaopinvsheng_mars_bigtts',
	  		isPlay: false
	  }, {
	    id: 52,
	    name: '萌丫头/Cutey',
	    type: 'zh_female_mengyatou_mars_bigtts',
	  		isPlay: false
	  }, {
	    id: 53,
	    name: '古风少御',
	    type: 'zh_female_gufengshaoyu_mars_bigtts',
	  		isPlay: false
	  }, {
	    id: 54,
	    name: '温柔淑女',
	    type: 'zh_female_wenroushunv_mars_bigtts',
	  		isPlay: false
	  }],
	  timbreboy: [{
	    id: 1,
	    name: '温暖阿虎/Alvin',
	    type: 'zh_male_wennuanahu_moon_bigtts',
	  		isPlay: false
	  }, {
	    id: 2,
	    name: '少年梓辛/Brayan',
	    type: 'zh_male_shaonianzixin_moon_bigtts',
	  		isPlay: false
	  }, {
	    id: 3,
	    name: '渊博小叔',
	    type: 'zh_male_yuanboxiaoshu_moon_bigtts',
	  		isPlay: false
	  }, {
	    id: 4,
	    name: '阳光青年',
	    type: 'zh_male_yangguangqingnian_moon_bigtts',
	  		isPlay: false
	  }, {
	    id: 5,
	    name: '解说小明',
	    type: 'zh_male_jieshuoxiaoming_moon_bigtts',
	  		isPlay: false
	  }, {
	    id: 6,
	    name: '邻家男孩',
	    type: 'zh_male_linjiananhai_moon_bigtts',
	  		isPlay: false
	  }, {
	    id: 7,
	    name: '京腔侃爷/Harmony',
	    type: 'zh_male_jingqiangkanye_moon_bigtts',
	  		isPlay: false
	  }, {
	    id: 8,
	    name: '湾区大叔',
	    type: 'zh_female_wanqudashu_moon_bigtts',
	  		isPlay: false
	  }, {
	    id: 9,
	    name: '广州德哥',
	    type: 'zh_male_guozhoudege_moon_bigtts',
	  		isPlay: false
	  }, {
	    id: 10,
	    name: '北京小爷',
	    type: 'zh_male_beijingxiaoye_moon_bigtts',
	  		isPlay: false
	  }, {
	    id: 11,
	    name: '浩宇小哥',
	    type: 'zh_male_haoyuxiaoge_moon_bigtts',
	  		isPlay: false
	  }, {
	    id: 12,
	    name: '广西远舟',
	    type: 'zh_male_guangxiyuanzhou_moon_bigtts',
	  		isPlay: false
	  }, {
	    id: 13,
	    name: '豫州子轩',
	    type: 'zh_male_yuzhouzixuan_moon_bigtts',
	  		isPlay: false
	  }, {
	    id: 14,
	    name: '傲娇霸总',
	    type: 'zh_male_aojiaobazong_moon_bigtts',
	  		isPlay: false
	  }, {
	    id: 15,
	    name: '深夜播客',
	    type: 'zh_male_shenyeboke_moon_bigtts',
	  		isPlay: false
	  }, {
	    id: 16,
	    name: '东方浩然',
	    type: 'zh_male_dongfanghaoran_moon_bigtts',
	  		isPlay: false
	  }, {
	    id: 17,
	    name: '清爽男大',
	    type: 'zh_male_qingshuangnanda_mars_bigtts',
	  		isPlay: false
	  }, {
	    id: 18,
	    name: '暖心体贴',
	    type: 'ICL_zh_male_nuanxintitie_tob',
	  		isPlay: false
	  }, {
	    id: 19,
	    name: '开朗轻快',
	    type: 'ICL_zh_male_kailangqingkuai_tob',
	  		isPlay: false
	  }, {
	    id: 20,
	    name: '活泼爽朗',
	    type: 'ICL_zh_male_huoposhuanglang_tob',
	  		isPlay: false
	  }, {
	    id: 21,
	    name: '率真小伙',
	    type: 'ICL_zh_male_shuaizhenxiaohuo_tob',
	  		isPlay: false
	  }, {
	    id: 22,
	    name: '奶气萌娃',
	    type: 'zh_male_naiqimengwa_mars_bigtts',
	  		isPlay: false
	  }, {
	    id: 23,
	    name: '绿茶小哥',
	    type: 'ICL_zh_male_lvchaxiaoge_tob',
	  		isPlay: false
	  }, {
	    id: 24,
	    name: '冷淡疏离',
	    type: 'ICL_zh_male_lengdanshuli_tob',
	  		isPlay: false
	  }, {
	    id: 25,
	    name: '憨厚敦实',
	    type: 'ICL_zh_male_hanhoudunshi_tob',
	  		isPlay: false
	  }, {
	    id: 26,
	    name: '傲气凌人',
	    type: 'ICL_zh_male_aiqilingren_tob',
	  		isPlay: false
	  }, {
	    id: 27,
	    name: '固执病娇',
	    type: 'ICL_zh_male_guzhibingjiao_tob',
	  		isPlay: false
	  }, {
	    id: 28,
	    name: '撒娇粘人',
	    type: 'ICL_zh_male_sajiaonianren_tob',
	  		isPlay: false
	  }, {
	    id: 29,
	    name: '潇洒随性',
	    type: 'ICL_zh_male_xiaosasuixing_tob',
	  		isPlay: false
	  }, {
	    id: 30,
	    name: '腹黑公子',
	    type: 'ICL_zh_male_fuheigongzi_tob',
	  		isPlay: false
	  }, {
	    id: 31,
	    name: '诡异神秘',
	    type: 'ICL_zh_male_guiyishenmi_tob',
	  		isPlay: false
	  }, {
	    id: 32,
	    name: '儒雅才俊',
	    type: 'ICL_zh_male_ruyacaijun_tob',
	  		isPlay: false
	  }, {
	    id: 33,
	    name: '病娇白莲',
	    type: 'ICL_zh_male_bingjiaobailian_tob',
	  		isPlay: false
	  }, {
	    id: 34,
	    name: '正直青年',
	    type: 'ICL_zh_male_zhengzhiqingnian_tob',
	  		isPlay: false
	  }, {
	    id: 35,
	    name: '青涩小生',
	    type: 'ICL_zh_male_qingsenaigou_tob',
	  		isPlay: false
	  }, {
	    id: 36,
	    name: '纯真学弟',
	    type: 'ICL_zh_male_chunzhenxuedi_tob',
	  		isPlay: false
	  }, {
	    id: 37,
	    name: '优柔帮主',
	    type: 'ICL_zh_male_youroubangzhu_tob',
	  		isPlay: false
	  }, {
	    id: 38,
	    name: '优柔公子',
	    type: 'ICL_zh_male_yourougongzi_tob',
	  		isPlay: false
	  }, {
	    id: 39,
	    name: '贴心男友',
	    type: 'ICL_zh_male_tiexinnanyou_tob',
	  		isPlay: false
	  }, {
	    id: 40,
	    name: '少年将军',
	    type: 'ICL_zh_male_shaonianjiangjun_tob',
	  		isPlay: false
	  }, {
	    id: 41,
	    name: '病娇哥哥',
	    type: 'ICL_zh_male_bingjiaogege_tob',
	  		isPlay: false
	  }, {
	    id: 42,
	    name: '学霸男同桌',
	    type: 'ICL_zh_male_xuebanantongzhuo_tob',
	  		isPlay: false
	  }, {
	    id: 43,
	    name: '幽默叔叔',
	    type: 'ICL_zh_male_youmoshushu_tob',
	  		isPlay: false
	  }, {
	    id: 44,
	    name: '冷峻上司',
	    type: 'ICL_zh_male_lengjunshangsi_tob',
	  		isPlay: false
	  }, {
	    id: 45,
	    name: '温柔男同桌',
	    type: 'ICL_zh_male_wenrounantongzhuo_tob',
	  		isPlay: false
	  }, {
	    id: 46,
	    name: '病娇弟弟',
	    type: 'ICL_zh_male_bingjiaodidi_tob',
	  		isPlay: false
	  }, {
	    id: 47,
	    name: '幽默大爷',
	    type: 'ICL_zh_male_youmodaye_tob',
	  		isPlay: false
	  }, {
	    id: 48,
	    name: '傲慢少爷',
	    type: 'ICL_zh_male_aomanshaoye_tob',
	  		isPlay: false
	  }, {
	    id: 49,
	    name: '神秘法师',
	    type: 'ICL_zh_male_shenmifashi_tob',
	  		isPlay: false
	  }, {
	    id: 50,
	    name: '天才童声',
	    type: 'zh_male_tiancaitongsheng_mars_bigtts',
	  		isPlay: false
	  }, {
	    id: 51,
	    name: '猴哥',
	    type: 'zh_male_sunwukong_mars_bigtts',
	  		isPlay: false
	  }, {
	    id: 52,
	    name: '熊二',
	    type: 'zh_male_xionger_mars_bigtts',
	  		isPlay: false
	  }, {
	    id: 53,
	    name: '广告解说',
	    type: 'zh_male_chunhui_mars_bigtts',
	  		isPlay: false
	  }, {
	    id: 54,
	    name: '四郎',
	    type: 'zh_male_silang_mars_bigtts',
	  		isPlay: false
	  }, {
	    id: 55,
	    name: '磁性解说男声/Morgan',
	    type: 'zh_male_jieshuonansheng_mars_bigtts',
	  		isPlay: false
	  }, {
	    id: 56,
	    name: '悬疑解说',
	    type: 'zh_male_changtianyi_mars_bigtts',
	  		isPlay: false
	  }, {
	    id: 57,
	    name: '儒雅青年',
	    type: 'zh_male_ruyaqingnian_mars_bigtts',
	  		isPlay: false
	  }, {
	    id: 58,
	    name: '霸气青叔',
	    type: 'zh_male_baqiqingshu_mars_bigtts',
	  		isPlay: false
	  }, {
	    id: 59,
	    name: '擎苍',
	    type: 'zh_male_qingcang_mars_bigtts',
	  		isPlay: false
	  }, {
	    id: 60,
	    name: '活力小哥',
	    type: 'zh_male_yangguangqingnian_mars_bigtts',
	  		isPlay: false
	  }],
      makeNewAvatar: {
		catid: 2,
		isrecommend: 0,
		status: 12,
		typeid: 1,
        title: '',
        description: '',
        imgurl: '',
        timbreName: '请选择音色',
		myTimbreName: '请选择音色',
        content: '',
		timbre: '',
        sex: 0,
		secret: 0,
        // roleName: '请选择性格',
        userid: 0,
		image_id: '',
		image_base64: '',
		image_encode: '',
      },
      typeList: [{
        id: "0",
        name: "女",
      }, {
        id: "1",
        name: "男",
      }],
	  typeList2: [{
	    id: "0",
	    name: "公开",
	  }, {
	    id: "1",
	    name: "私密",
	  }],
	  typeList3: [{
	    id: "0",
	    name: "否",
	  }, {
	    id: "1",
	    name: "是",
	  }],
      mTokenInfo: '',
      currentIndex: 0,
	  currentIndex2: 0,
	  currentIndex3: 0,
	  isMenuShow: false,
	  loginToken: uni.getStorageSync('loginToken') || '',
	  userInfo: uni.getStorageSync('userInfo') || null,
	  isvolcengine: false,
	  trueimgurl: '',
	  trueimgbase64: '',
	  trueimgtype: '',
	  cropperImageUrl: '',
	  volcenginebase64: '',
	  uploadingnum: 0,
	  showuploading: false,
	  intervalId: null,
	  submiting:false,
    }
  },
  onLoad(options) {
    // this.from = options.from || ''

    for (let i = 0; i < 80; i++) {
      this.points.push(new Point(Math.random() * w, Math.random() * h))
    }
    this.ctx = uni.createCanvasContext('star_canvas')
    // console.log(points)
	this.options = {
		url: ''
	};
	
	this.timbre = this.timbregirl;
	
	// let date = {
	// 	client_id: 'cycy_'+this.userInfo.userid.toString(),
	// };
	// // // let date2 = null;
	// this.abortController = new AbortController();
	// this.statusoptions = {
	// 	myDate: date,
	// 	signal: this.abortController.signal,
	// 	url: 'http://220.197.166.216:8881/work1091/imagehuman-lock-client-id'
	// };

    this.gameloop(); //进行
	this.islogin();
	this.getmyData();
	this.getmyTimerData();
	this.makeNewAvatar.userid = this.userInfo.userid;
    // this.ctx.setFillStyle('red')
    // this.ctx.fillRect(200, 300, 50, 50)
    // this.ctx.draw()
  },
  onShow() {
	this.islogin();
	this.getmyData();
	this.makeNewAvatar.userid = this.userInfo.userid;
	this.options = {
		url: ''
	};
	this.timbre = this.timbregirl;
  },
  onReady() {
	  // this.intervalId = setInterval(() => {
		 //    if(this.showuploading){
			// 	this.uploadingnum++;
			// 	console.log('uploadingnum:',this.uploadingnum);
			// 	if(this.uploadingnum > 4){
			// 		this.showuploading = false;
			// 	}
			// }
	  // }, 1000);
	  this.options = {
	  	url: ''
	  };
	  this.timbre = this.timbregirl;
  },
  onHide(){
  	// 页面隐藏时清除间隔调用
  	if (this.intervalId) {
  	    clearInterval(this.intervalId);
  	}
  },
  onUnload() {
	// 页面隐藏时清除间隔调用
	if (this.intervalId) {
	    clearInterval(this.intervalId);
	}
	  
    clearTimeout(this.timer)
  },

  methods: {
	acceptData(data) {
		  console.log('data:',data);
		  // some code
		  // let date2 = null;
		  if(data.type == 'success'){
				// console.log(data.end);
				this.loading = false;
		  }else if(data.type == 'star'){
			  this.loading = false;
			  this.makeNewAvatar.image_id = '';
		  }else{
			  this.loading = false;
			  this.makeNewAvatar.image_id = '';
			  // if(data.uuid != null){
				  console.log('datauuid:',data.uuid);
				  this.clear();
				  uni.showModal({
					showCancel: false,
					title: '设置失败',
					content: '图像不符合标准',
				  });
			  // }
		  }
	},
	acceptStatusData(data) {
		  console.log('StatusData:',data);
		  if(data.type == 'success'){
				
		  }else if(data.type == 'star'){
	
		  }else{
				// console.log('datauuid:',data.uuid);
				// this.clear();
				// uni.showModal({
				// 	showCancel: false,
				// 	title: '设置失败',
				// 	content: '图像不符合标准',
				// });
		  }
	},
	getmyTimerData (){
		let formData = {
		  	userid: this.userInfo.userid,
		};
		this.$Request.postApi("/module.php?m=aichat_api&a=ask&ajax=1",formData).then((res) => {
			if (res.error == 0) {
				// console.log(res);
				let resD = res.data.list;
				let myTimbreNameData = [];
				let myTimbreD = [];
				// this.timbreName = res.data.list;
				resD.forEach((timbre, index) => {
					myTimbreNameData[index] = '自定义-'+timbre.name;
					let mtData = {
						id: 0,
						name: '自定义-'+timbre.name,
						type: timbre.content,
						isPlay: false,
					};
					myTimbreD[index] = mtData;
				});
				this.timbre.push.apply(this.timbre, myTimbreD);
				this.timbreName.push.apply(this.timbreName, myTimbreNameData);
			} else {
				uni.showModal({
					showCancel: false,
					title: '数据获取失败',
					content: res.message,
				});
			}
		});
	},
	getmyData (){
		let formData = {
		  	userid: this.userInfo.userid,
		};
		this.$Request.postApi("/module.php?m=aichat_api&a=ask&ajax=1",formData).then((res) => {
			if (res.error == 0) {
				// console.log(res);
				let resD = res.data.list;
				// this.timbreName = res.data.list;
				resD.forEach((timbre, index) => {
					// console.log(index);
					this.myTimbre[index] = timbre.content;
					// console.log(this.myTimbre);
				});
			} else {
				uni.showModal({
					showCancel: false,
					title: '数据获取失败',
					content: res.message,
				});
			}
		});
	},
	islogin () {
	    if (this.loginToken == '') {
	      	uni.navigateTo({
	      		url: '/minePages/login'
	      	})
	    }
	},
	onPlay(id,type){
		this.makeNewAvatar.content = type;
		this.timbre[id-1].isPlay = true;
		this.timbre.forEach((timbre, index) => {
			if(index != id-1){
				this.timbre[index].isPlay = false;
			}
		});
		let date2 = {
			text: type
		};
		this.$Request.postT2("/api/core/user/tts", date2).then((res2) => {
			var obj = JSON.parse(res2.data.ttsInfo);
			console.log(obj.data);
			// innerAudioContext.src = obj.data;
			// innerAudioContext.play();
			var base64 = obj.data
			var fileName = (new Date()).valueOf() + '.wav'; // 我的base64是wav的音频，具体的格式自己写好
			base64ToFile(base64,fileName,function(path){
				console.log('pathresult',path);
				innerAudioContext.src = path;
				innerAudioContext.play();
				this.timbre[id-1].isPlay = false;
			})
		});
	},
	handleShow() {
		this.isMenuShow = !this.isMenuShow;
	},
	handleSuccess(e) {
	  // console.log('上传成功的返回值:', e);
	  this.trueimgurl = e.data.trueimgurl;
	  this.trueimgbase64 = e.data.base64;
	  this.trueimgtype = e.data.type;
	  
	  let formData = {
	    content: this.trueimgbase64,
	    type: "data:" + this.trueimgtype + ";base64,",
	  };
	  this.$Request.postApi("/index.php?m=upload&a=base64&ajax=1", formData).then((res2) => {
	  	this.$refs.imageUpload.setFileList("data:" + this.trueimgtype + ";base64," + res2.base64);
	  	this.$refs.imageUpload.remove(0);
	  	this.makeNewAvatar.imgurl = res2.imgurl;
	  	this.makeNewAvatar.image_id = 'cycy_'+this.userInfo.userid.toString() +'_'+ Date.now().toString();
	  	this.makeNewAvatar.image_base64 = res2.base64;
	  	this.makeNewAvatar.image_encode = this.trueimgtype.split("/")[1];
	  	// console.log(this.makeNewAvatar.imgurl);
	  	// let date = {
	  	// 	client_id: 'cycy_'+this.userInfo.userid.toString(),
	  	// 	image_id: this.makeNewAvatar.image_id,
	  	// 	rebuild: false,
	  	// 	image_base64: obj.data.image,
	  	// 	image_encode: e.data.type.split("/")[1],
	  	// };
	  	// // let date2 = null;
	  	// this.abortController = new AbortController();
	  	// this.options = {
	  	//     myDate: date,
	  	// 	signal: this.abortController.signal,
	  	// 	url: 'http://220.197.166.216:8881/work1091/imagehuman-process-to-talk'
	  	// };
	  	// this.loading = true;
	  }); 
	},
    onSelectType(id) {
	  // this.isMenuShow = false;
	  this.makeNewAvatar.content = '';
      this.currentIndex = id;
	  this.makeNewAvatar.sex = id;
	  if(id == 0){
		  this.timbre = this.timbregirl;
	  }else{
		  this.timbre = this.timbreboy;
	  }
	  this.timbre.forEach((timbre, index) => {
	  	  this.timbre[index].isPlay = false;
	  });
	  // console.log('男女:', id);
    },
	onSelectType2(id) {
	  this.currentIndex2 = id;
	  this.makeNewAvatar.secret = id;
	},
	onSelectType3(id) {
	  this.currentIndex3 = id;
	  if(id == 0){
		  if(this.trueimgbase64 == '' || this.trueimgbase64 == null){
			  uni.showToast({
			  title: '请先上传图片',
			  icon: 'none',
			  duration: 1000
			  })
			  return
		  }
		  let formData = {
		    content: "data:" + this.trueimgtype + ";base64," + this.trueimgbase64,
		  };
		  this.$Request.postApi("/index.php?m=upload&a=Base64_user_head&ajax=1", formData).then((res2) => {
		  		if (res2.error == 0) {	
		  			this.trueimgurl=res2.trueimgurl;
		  			this.makeNewAvatar.imgurl = res2.imgurl;
		  			this.makeNewAvatar.image_id = 'cycy_'+this.userInfo.userid.toString() +'_'+ Date.now().toString();
		  			this.makeNewAvatar.image_base64 = this.trueimgbase64;
		  			this.makeNewAvatar.image_encode = this.trueimgtype.split("/")[1];
		  		}
		  });
	  }
	},
    submit() {
      // uni.setStorageSync('makeNewAvatar', this.makeNewAvatar)
      // this.$Request.getT("/api/core/user/mtoken").then(async (res) => {
      //   if (res.code == 20000) {
      //     // console.log("nextCas");
      //     this.mTokenInfo = res.data.masterTokenInfo;
      //     let date = {
      //       accessToken: res.data.masterTokenInfo,
      //       cv: 'webgl_threejs@1.0',
      //       bodyId: 'nh_webreal_female_01',
      //       picture: 'http://8.130.47.242/upload/a1.jpg',
      //       saasModeling: true,
      //     };
      //     this.$Request.postH("/open/srv/avatar/createWithPicture", date).then((res) => {
      //       console.log(res);
      //     });
      //     // console.log('After await');
      //     // this.loading = false;
      //   }
      // });
	  if (!this.makeNewAvatar.title || this.makeNewAvatar.title == '') {
	    uni.showToast({
	  	title: '请设置智能体昵称',
	  	icon: 'none',
	  	duration: 1000
	    })
	    return
	  }
	  if (!this.makeNewAvatar.timbre || this.makeNewAvatar.timbre == '') {
	    uni.showToast({
	  	title: '请设置智能体开场白',
	  	icon: 'none',
	  	duration: 1000
	    })
	    return
	  }
	  if (!this.makeNewAvatar.description || this.makeNewAvatar.description == '') {
	    uni.showToast({
	  	title: '请设置智能体简介',
	  	icon: 'none',
	  	duration: 1000
	    })
	    return
	  }
	  if (!this.makeNewAvatar.imgurl || this.makeNewAvatar.imgurl == '') {
	    uni.showToast({
	  	title: '请上传智能体形象',
	  	icon: 'none',
	  	duration: 1000
	    })
	    return
	  }
	  if (!this.makeNewAvatar.content || this.makeNewAvatar.content == '') {
	    uni.showToast({
	  	title: '请选择智能体音色',
	  	icon: 'none',
	  	duration: 1000
	    })
	    return
	  }
	  this.submiting = true;
      // console.log('makeNewAvatar:' + JSON.stringify(this.makeNewAvatar));
	  let formData = {
	  	catid: this.makeNewAvatar.catid,
		content: this.makeNewAvatar.content,
		description: this.makeNewAvatar.description,
		imgurl: this.makeNewAvatar.imgurl,
		isrecommend: this.makeNewAvatar.isrecommend,
		sex: this.makeNewAvatar.sex,
		secret: this.makeNewAvatar.secret,
		status: this.makeNewAvatar.status,
		timbre: this.makeNewAvatar.timbre,
		title: this.makeNewAvatar.title,
		typeid: this.makeNewAvatar.typeid,
		userid: this.makeNewAvatar.userid,
		image_id: this.makeNewAvatar.image_id,
		image_base64: this.makeNewAvatar.image_base64,
		image_encode: this.makeNewAvatar.image_encode,
	  };
	  this.$Request.postApi("/module.php?m=aichat_zhushou&a=save&ajax=1",formData).then((res) => {
	  		if (res.error == 0) {
				this.submiting = false;
				uni.showToast({
				title: '智能体创建成功',
				icon: 'none',
				duration: 1000
				});
				uni.reLaunch({
					url: '/circlePages/king'
				});
	  		} else {
	  			uni.showModal({
	  				showCancel: false,
	  				title: '创建失败',
	  				content: res.message,
	  			});
	  		}
	  });
    },
	radioCheck(type){
		this.makeNewAvatar.content = type;
	},
    onChangeSex(e) {
      this.makeNewAvatar.sex = this.sexList[e.detail.value].id;
    },
    onChangeContent(e) {
      this.makeNewAvatar.content = this.timbre[e.detail.value].type;
      this.makeNewAvatar.timbreName = this.timbre[e.detail.value].name;
    },
	onChangeVolcengine(e){
		this.volcengineName = this.volcengine[e.detail.value];
		// this.$refs.imageUpload.remove(0);
		if(this.volcengineName == '选择美化特效' || this.volcengineName == '不美化特效'){
			if(this.trueimgbase64 == '' || this.trueimgbase64 == null){
			  uni.showToast({
			  title: '请先上传图片',
			  icon: 'none',
			  duration: 1000
			  })
			  return
			}
			let formData = {
			  content: "data:" + this.trueimgtype + ";base64," + this.trueimgbase64,
			};
			this.$Request.postApi("/index.php?m=upload&a=Base64_user_head&ajax=1", formData).then((res2) => {
					if (res2.error == 0) {	
						this.trueimgurl=res2.trueimgurl;
						this.makeNewAvatar.imgurl = res2.imgurl;
						this.makeNewAvatar.image_id = 'cycy_'+this.userInfo.userid.toString() +'_'+ Date.now().toString();
						this.makeNewAvatar.image_base64 = this.trueimgbase64;
						this.makeNewAvatar.image_encode = this.trueimgtype.split("/")[1];
					}
			});
		}else{
			if(this.trueimgurl == '' || this.trueimgurl == null){
			  uni.showToast({
			  title: '请先上传图片',
			  icon: 'none',
			  duration: 1000
			  })
			  return
			}
			let volcenginetype = 0;
			if(this.volcengineName == '智能变美'){
					  volcenginetype = 1;
			}
			if(this.volcengineName == '幻想风美颜'){
					  volcenginetype = 2;
			}
			if(this.volcengineName == '人像特效/3D卡通风'){
					  volcenginetype = 3;
			}
			if(this.volcengineName == '人像特效/天使'){
					  volcenginetype = 4;
			}
			if(this.volcengineName == '人像特效/恶魔'){
					  volcenginetype = 5;
			}
			if(this.volcengineName == '3d超写实风格'){
					  volcenginetype = 6;
			}
			
			let formData2 = {
					fileurlstring: this.trueimgurl,
					type: volcenginetype,
			};
			this.$Request.postT2("/api/core/user/volcengineapi",formData2).then((res) => {
			// 处理上传成功后的逻辑
				var obj = JSON.parse(res.data.res);
				if(obj.code == 10000){
					// console.log(obj);
					// this.imageBase64 = "data:" + this.trueimgtype + ";base64," + obj.data.image;
					// this.$refs.imageUpload.setFileList("data:" + this.trueimgtype + ";base64," + obj.data.image);
					// this.$refs.imageUpload.remove(0);
					this.volcenginebase64 = obj.data.image;
					
					let formData = {
					  content: "data:" + this.trueimgtype + ";base64," + obj.data.image,
					};
					this.$Request.postApi("/index.php?m=upload&a=Base64_user_head&ajax=1", formData).then((res2) => {
						// this.$refs.imageUpload.setFileList("data:" + this.trueimgtype + ";base64," + res2.base64);
						// this.$refs.imageUpload.remove(0);
						this.trueimgurl = "data:" + this.trueimgtype + ";base64," + obj.data.image;
						this.makeNewAvatar.imgurl = res2.imgurl;
						this.makeNewAvatar.image_id = 'cycy_'+this.userInfo.userid.toString() +'_'+ Date.now().toString();
						this.makeNewAvatar.image_base64 = this.volcenginebase64;
						this.makeNewAvatar.image_encode = this.trueimgtype.split("/")[1];
						// console.log(this.makeNewAvatar.imgurl);
						// let date = {
						// 	client_id: 'cycy_'+this.userInfo.userid.toString(),
						// 	image_id: this.makeNewAvatar.image_id,
						// 	rebuild: false,
						// 	image_base64: obj.data.image,
						// 	image_encode: e.data.type.split("/")[1],
						// };
						// // let date2 = null;
						// this.abortController = new AbortController();
						// this.options = {
						//     myDate: date,
						// 	signal: this.abortController.signal,
						// 	url: 'http://220.197.166.216:8881/work1091/imagehuman-process-to-talk'
						// };
						// this.loading = true;
					}); 
				}else{
					this.clear();
					uni.showModal({
						showCancel: false,
						title: '设置失败',
						content: obj.message,
					});
				}
			});
		}
	},
	onChangeTimbre(e) {
      this.makeNewAvatar.timbre = this.myTimbre[e.detail.value];
      this.makeNewAvatar.myTimbreName = this.myTimbre[e.detail.value];
    },
    onChangeRole(e) {
      this.makeNewAvatar.role = this.role[e.detail.value];
      this.makeNewAvatar.roleName = this.roleList[e.detail.value];
    },
    // 切换模式
    modeSwitch(index) {
      this.currentModeIndex = index + 1
      this.showPassword = false
    },
    /**粒子进行*/
    gameloop() {
      this.timer = setTimeout(this.gameloop, 100);
      // console.log('gameloop')
      this.paint();
    },
    /**清空画布*/
    paint() {
      this.ctx.clearRect(0, 0, w, h)
      for (var i = 0; i < this.points.length; i++) {
        this.points[i].move(w, h)
        this.points[i].draw(this.ctx)
        for (var j = i + 1; j < this.points.length; j++) {
          this.points[i].drawLine(this.ctx, this.points[j])
        }
      }
      this.ctx.draw();
    },
    // 手动上传文件
    upload() {
      this.$refs.imageUpload.upload()
    },
    // 手动清空列表
    clear() {
      // this.$refs.imageUpload.clear()
	  this.trueimgurl='';
	  this.trueimgbase64 = '';
	  this.trueimgtype = '';
	  this.makeNewAvatar.imgurl = '';
	  this.makeNewAvatar.image_id = '';
	  this.makeNewAvatar.image_base64 = '';
	  this.makeNewAvatar.image_encode = '';
	  this.currentIndex3 = 0;
	  this.showuploading = false;
    },
	// 使用uni.compressImage压缩图片
	compressImage() {
	  uni.chooseImage({
	    count: 1,
	    sizeType: ['original'],
	    success: (res) => {
	      uni.showLoading({
	        title: "处理中...",
	        mask: true,
	      });
	      // 使用uni.compressImage压缩图片
	      uni.compressImage({
	        src: res.tempFilePaths[0],
	        quality: 80, // 压缩质量
	        success: (compressRes) => {
	          this.model.imageUrl = compressRes.tempFilePath;
	        },
	        fail: (err) => {
	          console.error("图片压缩失败：", err);
	        },
	        complete: () => {
	          uni.hideLoading(); // 关闭loading
	        },
	      });
	    },
	  });
	},
	// 使用默认压缩方式
	defaultCompressImage() {
	  uni.chooseImage({
	    count: 1,
	    sizeType: ['compressed'],
	    success: (res) => {
	      this.model.imageUrl = res.tempFilePaths[0];
	    },
	  });
	},
	/**
	 *** 特别声明：在使用uni.chooseImage选择的大图片文件无法直接在Image组件中显示，通常涉及到以下可能的问题和限制。
	 *** 图片大小和尺寸限制：移动设备和浏览器对于能够加载和处理的图片大小有限制，如果选择的图片文件尺寸过大，可能无法正常加载和显示。
	 *** 性能问题：大图片文件可能会导致页面加载缓慢或者卡顿，尤其是在移动设备上。
	 *** 内存问题：加载大图片可能会消耗大量的内存资源，特别是在移动设备上，可能导致内存不足或者页面崩溃的问题。
	 *** 解决参考方案如下：
	 *** 防止选择大文件图片后无法在Image中直接临时路径显示图片，导致无法在裁剪插件中显示，
	 *** 根据项目需要对大尺寸图片进行压缩、对图片质量要求高的，需要提前上传至oss进行采用网络图片进行裁剪。
	 */
	accredit() {
		plus.android.requestPermissions(['android.permission.CAMERA'],
			(e) => {
				if (e.deniedAlways.length > 0) {
					// 弹出提示框解释为何需要权限，引导用户打开设置页面开启  
					uni.showModal({
						title: '提示',
						content: '请打开手机相机相册功能（点击确定后在权限中授权相机相册功能）',
						// showCancel: false, // 不显示取消按钮
						success(res) {
							if (res.confirm) {
								var Intent = plus.android.importClass("android.content.Intent");
								var Settings = plus.android.importClass(
									"android.provider.Settings");
								var Uri = plus.android.importClass("android.net.Uri");
								var mainActivity = plus.android.runtimeMainActivity();
								var intent = new Intent();
								intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
								var uri = Uri.fromParts("package", mainActivity.getPackageName(),
									null);
								intent.setData(uri);
								mainActivity.startActivity(intent);
							}
						}
					});
				} else if (e.deniedPresent.length > 0) { //权限被临时拒绝  
					// 弹出提示框解释为何需要权限，可再次调用plus.android.requestPermissions申请权限  
					uni.showModal({
						title: '提示',
						content: '请打开手机相机功能（点击确定后在权限中授权相机功能）',
						// showCancel: false, // 不显示取消按钮
						success(res) {
							if (res.confirm) {
								var Intent = plus.android.importClass("android.content.Intent");
								var Settings = plus.android.importClass(
									"android.provider.Settings");
								var Uri = plus.android.importClass("android.net.Uri");
								var mainActivity = plus.android.runtimeMainActivity();
								var intent = new Intent();
								intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
								var uri = Uri.fromParts("package", mainActivity.getPackageName(),
									null);
								intent.setData(uri);
								mainActivity.startActivity(intent);
							}
						}
					});
				} else {
					plus.android.requestPermissions(['android.permission.READ_EXTERNAL_STORAGE'], (e) => {
						if (e.deniedAlways.length > 0) { //权限被永久拒绝  
							// 弹出提示框解释为何需要权限，引导用户打开设置页面开启  
							uni.showModal({
								title: '提示',
								content: '请打开相册存储功能（点击确定后在权限中授权相册存储功能）',
								// showCancel: false, // 不显示取消按钮
								success(res) {
									if (res.confirm) {
										var Intent = plus.android.importClass(
											"android.content.Intent");
										var Settings = plus.android.importClass(
											"android.provider.Settings");
										var Uri = plus.android.importClass("android.net.Uri");
										var mainActivity = plus.android.runtimeMainActivity();
										var intent = new Intent();
										intent.setAction(Settings
											.ACTION_APPLICATION_DETAILS_SETTINGS);
										var uri = Uri.fromParts("package", mainActivity
											.getPackageName(),
											null);
										intent.setData(uri);
										mainActivity.startActivity(intent);
									}
								}
							});
						} else if (e.deniedPresent.length > 0) { //权限被临时拒绝  
							// 弹出提示框解释为何需要权限，可再次调用plus.android.requestPermissions申请权限  
							uni.showModal({
								title: '提示',
								content: '请打开相册存储功能（点击确定后在权限中授权相册存储功能）',
								// showCancel: false, // 不显示取消按钮
								success(res) {
									if (res.confirm) {
										var Intent = plus.android.importClass(
											"android.content.Intent");
										var Settings = plus.android.importClass(
											"android.provider.Settings");
										var Uri = plus.android.importClass("android.net.Uri");
										var mainActivity = plus.android.runtimeMainActivity();
										var intent = new Intent();
										intent.setAction(Settings
											.ACTION_APPLICATION_DETAILS_SETTINGS);
										var uri = Uri.fromParts("package", mainActivity
											.getPackageName(),
											null);
										intent.setData(uri);
										mainActivity.startActivity(intent);
									}
								}
							});
						} else {
							//在此处可以进行操作可以使用uni.chooseImage()

						}
					})
				}
			})
	},
	selectFile() {
		this.accredit();
		this.loading = true;
	  // 推荐使用其他压缩方式：这里只是简单对大文件图片压缩-仅供思路参考，切勿使用该方式
	  // 示例一：uni.compressImage压缩图片
	  // this.compressImage();
	
	  // 示例二：使用自带压缩图
	  this.defaultCompressImage();
	},
	
	// 关闭
	onCancel() {
	  this.model.imageUrl = "";
	  this.loading = false;
	},
	
	extractImageTypeWithRegex(base64String) {
	    // 使用正则表达式匹配图片类型
	    const regex = /^data:image\/(\w+);base64,/;
	    const match = base64String.match(regex);
	    if (match && match[1]) {
	        return match[1]; // 返回匹配的图片类型，例如 'jpeg' 或 'png'
	    }
	    return null; // 如果没有匹配到，返回null
	},
	
	// 确定裁剪
	onConfirm(res) {
	  this.loading = false;
	  this.uploadingnum = 0;
	  this.showuploading = true;
	  
	  let that = this;
	  const params = {
	    id: new Date().getTime(),
	    url: res.tempFilePath,
	  };
	  this.model.resultUrl.push(params);
	  
	  pathToBase64(res.tempFilePath)
	    .then(base64 => {
		   // that.uploading = true;
		   // console.log("onConfirm_Base64");
	       let formData = {
	         content: base64
	       };
	       that.$Request.postApi("/index.php?m=upload&a=Base64_user_head&ajax=1", formData).then((res2) => {
	       		if (res2.error == 0) {
	       			that.trueimgurl=res2.trueimgurl;
					that.trueimgbase64 = base64.split(',')[1];
					that.trueimgtype = 'image/' + this.extractImageTypeWithRegex(base64);
					that.makeNewAvatar.imgurl = res2.imgurl;
					that.makeNewAvatar.image_id = 'cycy_'+this.userInfo.userid.toString() +'_'+ Date.now().toString();
					that.makeNewAvatar.image_base64 = this.trueimgbase64;
					that.makeNewAvatar.image_encode = this.trueimgtype.split("/")[1];
					that.currentIndex3 = 0;
					that.showuploading = false;
	       		}
	       });
	    })
	    .catch(error => {
	      console.error(error)
	    })
	  
	  this.model.imageUrl = "";
	},
	
	// 预览图片
	prviewImgae(index, url) {
	  uni.previewImage({
	    current: index, // 当前资源下标
	    urls: [url],
	  });
	},
  }
}
</script>
<script module="renderScript" lang="renderjs">
    export default {
        methods: {
          onChange(newValue, oldValue, ownerInstance) {
			const url = 'http://220.197.166.216:8881/work1091/imagehuman-ready-to-talk';
			let eventData = '';
			let myframe = 0;
			let prompt = '';
			let end = 0;
			if(newValue.url != ''){
				fetch(newValue.url, {
				  signal: newValue.signal,
				  method: 'POST',
				  headers: {
					'Content-Type': 'application/json'
				  },
				  body: JSON.stringify(newValue.myDate) // 将请求体转换为 JSON 字符串
				})
				.then(response => response.json())
				.then(data => {
					if (data.status === 'success') {
					  ownerInstance.callMethod('acceptData', { type: 'success'});
					} else {
					  ownerInstance.callMethod('acceptData', { type: 'error', uuid: newValue.myDate.uuid });
					}	
				  })
				.catch(error => {
				  ownerInstance.callMethod('acceptData', { type: 'error', uuid: null });
				});
				
			  }else{
				  ownerInstance.callMethod('acceptData', { type: 'star' });
			  }
		  },
		  checkConnectionStatus(newValue, oldValue, ownerInstance) {
		  	const url = 'http://220.197.166.216:8881/work1091/imagehuman-connection-status';
		  	let eventData = '';
		  	let myframe = 0;
		  	let prompt = '';
		  	let end = 0;
		  	if(newValue.url != ''){
		  		fetch(newValue.url, {
		  		  signal: newValue.signal,
		  		  method: 'POST',
		  		  headers: {
		  			'Content-Type': 'application/json'
		  		  },
		  		  body: JSON.stringify(newValue.myDate) // 将请求体转换为 JSON 字符串
		  		})
		  		.then(response => response.json())
		  		.then(data => {
		  			if (data.status === 'success') {
		  			  ownerInstance.callMethod('acceptStatusData', { type: 'success' , data: data});
		  			} else {
		  			  ownerInstance.callMethod('acceptStatusData', { type: 'error', data: data });
		  			}	
		  		  })
		  		.catch(error => {
		  		  ownerInstance.callMethod('acceptStatusData', { type: 'error', data: data });
		  		});
		  		
		  	}else{
		  		ownerInstance.callMethod('acceptStatusData', { type: 'star' });
		  	}
		  },
        }
    }
</script>

<style lang="scss" scoped>
.preview {
  padding: 32rpx;

  .images {
    margin: 10rpx;
    width: 200rpx;
    height: 200rpx;
  }
  
  .images2 {
    width: 200rpx; 
	height: 433rpx; 
  }
  
  .images3 {
    margin: 10rpx;
    width: 64rpx;
    height: 64rpx;
  }
}
.button {
  margin: 0 20rpx;
}
.input-box {
  background-color: #282a2e;
  margin: 15px 17px;
  border-radius: 15px;
  padding: 15px 0;

  .tn-text {
    padding: 5px 10px 0px 15px;
    color: #FFFFFF;
    font-size: 16px;
  }

  .tn-text1 {
    padding: 2px;
    color: #FFFFFF;
    font-size: 16px;
  }

  .tn-bg-gray--light {
    background-color: #3c3d3e !important;
  }

  .input-placeholder {
    font-size: 13px;
    color: #C6D1D8;
  }

  .topic__info__item__input {
    color: #fff;
    padding-left: 10px;
  }

  .topic__info__item__input {
    margin-top: 15px;
    margin-bottom: 15px;
  }

  .select-content {
    display: flex;
    align-items: center;
    margin-top: 10px;

    .select-content-item {
      display: flex;
      align-items: center;
      justify-content: center;
      color: #fff;
      width: 72px;
      height: 35px;
      border-radius: 24px;
      border: 0.5px solid #ccc;
      margin-right: 10px;
    }

    .select-content-item-active {
      border: 1px solid #EDC454;
      color: #EDC454;
    }
  }


}

.input-box-padding {
  padding: 15px 10px;
}

.input-box-padding2 {
  padding: 10px 10px;
  padding-bottom: 130px;
}

.bottom-box {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 999;
  padding-bottom: calc(24rpx + constant(safe-area-inset-bottom));
  padding-bottom: calc(24rpx + env(safe-area-inset-bottom));
  background-color: #1c1d20;
}

/* 胶囊*/
.tn-custom-nav-bar__back {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  justify-content: space-evenly;
  align-items: center;
  box-sizing: border-box;
  background-color: rgba(0, 0, 0, 0.15);
  border-radius: 1000rpx;
  border: 1rpx solid rgba(255, 255, 255, 0.5);
  color: #FFFFFF;
  font-size: 18px;

  .icon {
    display: block;
    flex: 1;
    margin: auto;
    text-align: center;
  }

  &:before {
    content: " ";
    width: 1rpx;
    height: 110%;
    position: absolute;
    top: 22.5%;
    left: 0;
    right: 0;
    margin: auto;
    transform: scale(0.5);
    transform-origin: 0 0;
    pointer-events: none;
    box-sizing: border-box;
    opacity: 0.7;
    background-color: #FFFFFF;
  }
}

/* 粒子背景 start*/
.template-topic {
  background: linear-gradient(90deg, #1c1d21, #1c1d21);
  min-height: 100vh
}

.mycanvas {
  position: fixed;
  background-size: cover;
  width: 100vw;
  height: 100vh;
  justify-content: center;
  flex-direction: column;
  color: #fff;
}

.ring {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      width: 150px;
      height: 150px;
      background: transparent;
      border: 3px solid #3c3c3c;
      border-radius: 50%;
      text-align: center;
      line-height: 150px;
      font-family: sans-serif;
      font-size: 20px;
      color: #fff000;
      letter-spacing: 4px;
      text-transform: uppercase;
      text-shadow: 0 0 10px #fff000;
      box-shadow: 0 0 20px rgba(0, 0, 0, .5);
  	
  	text {
  	    display: block;
  	    position: absolute;
  	    top: calc(50% - 2px);
  	    left: 50%;
  	    width: 50%;
  	    height: 4px;
  	    background: transparent;
  	    transform-origin: left;
  	    animation: animate 2s linear infinite;
  	}
  	
  	text:before {
  	    content: '';
  	    position: absolute;
  	    width: 16px;
  	    height: 16px;
  	    border-radius: 50%;
  	    background: #fff000;
  	    top: -6px;
  	    right: -8px;
  	    box-shadow: 0 0 20px #fff000;
  	}
  }
  
  .ring:before {
      content: '';
      position: absolute;
      top: -3px;
      left: -3px;
      width: 100%;
      height: 100%;
      border: 3px solid transparent;
      border-top: 3px solid #fff000;
      border-right: 3px solid #fff000;
      border-radius: 50%;
      animation: animateC 2s linear infinite;
  }



.topic {
  position: relative;
  height: 100%;
  z-index: 1;
  margin-bottom: 120rpx;


  /* 表单信息 start */
  &__info {
    margin: 105rpx 50rpx 0rpx 50rpx;
    padding: 30rpx 50rpx 50rpx 50rpx;
    border-radius: 20rpx;
    background-color: rgba(255, 255, 255, 1);
    border: 2rpx solid rgba(255, 255, 255, 0.1);
    box-shadow: 0rpx 10rpx 50rpx 0rpx rgba(0, 3, 72, 0.1);

    &__item {

      &__input {
        margin-top: 59rpx;
        width: 100%;
        height: 77rpx;
        border: 1rpx solid #C6D1D8;
        border-radius: 39rpx;

        &__left-icon {
          width: 10%;
          font-size: 44rpx;
          margin-left: 20rpx;
          color: #78909C;
        }

        &__content {
          width: 80%;
          padding-left: 10rpx;

          &--verify-code {
            width: 56%;
          }

          input {
            font-size: 30rpx;
            color: #78909C;
            // letter-spacing: 0.1em;
          }
        }

        &__right-icon {
          width: 10%;
          font-size: 34rpx;
          margin-right: 20rpx;
          color: #78909C;
        }

        &__right-verify-code {
          width: 34%;
          margin-right: 20rpx;
        }
      }

      &__button {
        margin-top: 59rpx;
        width: 100%;
        height: 77rpx;
        text-align: center;
        font-size: 31rpx;
        font-weight: bold;
        line-height: 77rpx;
        // text-indent: 1em;
        border-radius: 100rpx;
        color: #FFFFFF;
        background-color: rgba(255, 255, 255, 0.2);
        // border: 2rpx solid #FFFFFF;
      }

      &__sure {
        margin-top: 75rpx;
        margin-bottom: 39rpx;
        width: 100%;
        letter-spacing: 0.5em;
      }

    }
  }

  /* 表单信息 end */

  /* 内容 end */

}

::v-deep.input-placeholder {
  font-size: 30rpx;
  color: #C6D1D8;
}
</style>
